
define([
        "jquery",
        "IO",
        "UPLOADUI",
        "UPLOAD",
        "jqueryUI",
        "bootbox"
    ], function ($, IO, upui, up, jui, bootbox, definebt) {
        $(function () {
            gettable();
            function gettable() {
                var grid;
                //每列数据列性
                var columns = [
                    {
                        title: '编号',
                        dataIndex: 'train_id',
                        dataSource: function (data, datarow, gridobj, current_column) {
                            return "<span>" + data[datarow].train_id + "</span>";
                        }
                    },
                    {
                        title: '名称',
                        dataIndex: 'train_name',
                        dataSource: function (data, datarow, gridobj, current_column) {
                            return "<span>" + data[datarow].train_name + "</span>";
                        }
                    },
                    {
                        title: '操作',
                        dataIndex: 'action',
                        dataSource: function (data, datarow, gridobj, current_column) {
                            return "<span><a href='#' class='into' style='color: green;' train_id='"+data[datarow].train_id+"'>进入报告</a></span>";
                        }
                    },

                ];


                //数组初始化
                function dataInit() {
                    grid = new Grid("/trainsList", $("#table_my_toast"), $("#paging_my_toast"), 1, 10, columns, get_input_param(), 10);
                    //初始化
                    grid.Init();
                }

                //获取输入框内容
                function get_input_param() {

                    return "";
                }
                dataInit();

            }
           //点击进入报告
           $(document).on('click','.into',function () {
             var train_id=  $(this).attr('train_id');//培训id
             window.location.href='/reportManagement?train_id='+train_id;

           })
        })
    }

)
